package com.Ajava1801D.并发包.semphfore;

import com.Ajava1801D.并发包.cyclicreby.TestCyc;

import java.util.concurrent.Semaphore;

/**
 * @author: LCG
 * 作者: LCG
 * 日期: 2020/10/7  15:42
 * 描述:
 */
public class TestSem2222 {

    public static void main(String[] args) {

        Semaphore semaphore=new Semaphore(2);

        Thread t1=new Thread(new SemRun2222(semaphore,2),"A");
        Thread t2=new Thread(new SemRun2222(semaphore,3),"B");
        Thread t3=new Thread(new SemRun2222(semaphore,6),"C");
        Thread t4=new Thread(new SemRun2222(semaphore,4),"D");
        Thread t5=new Thread(new SemRun2222(semaphore,1),"E");

        t1.start();
        t2.start();
        t3.start();
        t4.start();
        t5.start();

    }

}
